package com.ys.web.user.friends.service;

import com.ys.web.user.friends.po.BaseGroupInfoPO;
import com.ys.web.user.friends.po.BaseUserFriendsPO;
import com.ys.web.user.friends.vo.*;

import java.util.List;
import java.util.Set;

/**
 * @author quxinjun
 * @version 1.0.0
 * @ClassName GroupService.java
 * @Description GroupService
 * @createTime 2021年05月13日 19:36:00
 */
public interface GroupService {

    /**
     * @param uid     操作人（群主）
     * @param members 成员列表
     * @return
     * @title addGroup
     * @description 添加组信息
     * @author quxinjun
     * @updateTime 2021/5/13 19:38
     */
    Long addGroup(Long uid, String name, Set<String> members);

    /**
     * @param uid     用户id
     * @param groupId 群id
     * @title delGroup
     * @description 删除群
     * @author quxinjun
     * @updateTime 2021/5/14 17:37
     */
    void delGroup(Long uid, String groupId);

    /**
     * @param uid      操作人id
     * @param groupId  组id
     * @param memberId 成员id
     * @title turnGroup
     * @description 移交群信息
     * @author quxinjun
     * @updateTime 2021/5/14 19:43
     */
    void turnGroup(Long uid, String groupId, String memberId);

    /**
     * @param uid      用户id
     * @param memberId 成员id
     * @param groupId  群id
     * @title delMemberByMemberId
     * @description
     * @author quxinjun
     * @updateTime 2021/5/18 11:12
     */
    void delMemberByMemberId(Long uid, String memberId, String groupId);

    /**
     * @param uid     操作人id
     * @param groupId 组id
     * @title getCanInviteList
     * @description 获取当前用户可邀请的成员信息
     * @author quxinjun
     * @updateTime 2021/5/18 14:27
     * @return: java.util.List<com.ys.web.user.friends.po.BaseUserFriendsPO>
     */
    List<BaseUserFriendsPO> getCanInviteList(Long uid, String groupId);

    /**
     * @param uid     操作人id
     * @param groupId 组id
     * @title getCanDeleteList
     * @description 获取可删除的成员信息
     * @author quxinjun
     * @updateTime 2021/5/25 10:35
     * @return: java.util.List<com.ys.web.user.friends.po.BaseUserFriendsPO>
     */
    List<UserGroupVO> getCanDeleteList(Long uid, String groupId);

    /**
     * @param uid     操作用户id
     * @param groupId 组id
     * @title getGroupDetail
     * @description 获取组的信息（人员信息，组的基础信息）
     * @author quxinjun
     * @updateTime 2021/5/18 16:46
     * @return: com.ys.web.user.friends.vo.UserGroupInfoVO
     */
    UserGroupInfoVO getGroupDetail(Long uid, String groupId);

    /**
     * @param groupId 组id
     * @param uid     用户id
     * @title getGroupBaseInfo
     * @description 获取组的基本信息
     * @author quxinjun
     * @updateTime 2021/5/25 11:07
     * @return: com.ys.web.user.friends.po.BaseGroupInfoPO
     */
    BaseGroupInfoPO getGroupBaseInfo(Long uid, String groupId);


    /**
     * @param uid     操作用户id
     * @param groupId 群id
     * @param type    操作类型
     * @param value   值
     * @title setGroupBase
     * @description 设置基本信息
     * @author quxinjun
     * @updateTime 2021/5/19 10:05
     */
    void setGroupBase(Long uid, String groupId, Integer type, String value);

    /**
     * @param uid      用户id
     * @param groupId  组id
     * @param memberId 成员id
     * @title addGroupMember
     * @description
     * @author quxinjun
     * @updateTime 2021/5/19 13:36
     */
    void addGroupMember(Long uid, String groupId, String memberId);

    /**
     * @param uid   操作用户id
     * @param query 查询关键字
     * @title getGroupList
     * @description 获取用户的群集合
     * @author quxinjun
     * @updateTime 2021/5/19 15:13
     * @return: java.util.List<com.ys.web.user.friends.po.BaseGroupInfoPO>
     */
    List<BaseGroupInfoPO> getGroupList(Long uid, String query);

    /**
     * @param groupId 组id
     * @title getGroupMembersSize
     * @description 获取指定群当前的人数
     * @author quxinjun
     * @updateTime 2021/5/21 17:51
     * @return: int
     */
    int getGroupMembersSize(String groupId);

    /**
     * @param uid      操作人id
     * @param memberId 成员id
     * @param type     操作类型
     * @param groupId  组id
     * @title audit
     * @description
     * @author quxinjun
     * @updateTime 2021/5/24 16:45
     */
    void audit(String groupId, Long uid, String memberId, Integer type);

    /**
     * @param uid     操作人id
     * @param groupId 组id
     * @title getUnAuditMemberList
     * @description 获取未审核人员集合
     * @author quxinjun
     * @updateTime 2021/5/24 17:53
     * @return: java.util.List<?>
     */
    List<UnAuditVO> getUnAuditMemberList(Long uid, String groupId);

    /**
     * @param uid     操作人id
     * @param groupId 组id
     * @title exitGroupByGroupId
     * @description 退出群
     * @author quxinjun
     * @updateTime 2021/5/24 18:39
     */
    void exitGroupByGroupId(Long uid, String groupId);

    /**
     * @param groupId 组id
     * @param type    操作类型【0：踢出,2：退出】
     * @param
     * @title getMemberLeaveList
     * @description 获取退群成员或踢出成员集合
     * @author quxinjun
     * @updateTime 2021/5/24 20:06
     */
    List<UnAuditVO> getMemberLeaveList(String groupId, Integer type, String searchKey);

    /**
     * @param uid      操作人id
     * @param groupId  组id
     * @param inviteId 邀请人id
     * @title joinGroup
     * @description 用户通过去id 加入群聊
     * @author quxinjun
     * @updateTime 2021/5/25 11:56
     */
    void joinGroup(Long uid, String groupId, String inviteId);

    /**
     * @param groupId 组id
     * @title getInactiveList
     * @description 获取不活跃成员信息
     * @author quxinjun
     * @updateTime 2021/5/25 19:27
     * @return: com.ys.web.user.friends.vo.InactiveVO
     */
    InactiveVO getInactiveList(Long uid, String groupId);

    /**
     * @param uid
     * @param groupId
     * @param searchKey
     * @title getCurrentGroupMembers
     * @description 获取当前群组成员信息
     * @author quxinjun
     * @updateTime 2021/5/26 11:52
     * @return: java.util.List<com.ys.web.user.friends.vo.UnAuditVO>
     */
    List<UserGroupVO> getCurrentGroupMembers(Long uid, String groupId, String searchKey);

    /**
     * @param groupId  群组id
     * @param memberId 成员id
     * @title queryMemberInfo
     * @description 获取成员信息
     * @author quxinjun
     * @updateTime 2021/5/28 13:41
     * @return: com.ys.web.user.friends.po.BaseUserFriendsPO
     */
    BaseUserFriendsPO queryMemberInfo(Long uid, String groupId, String memberId);

    /**
     * @param uid     操作人id
     * @param groupId 群id
     * @title getGroupApiInfo
     * @description 获取群助手信息
     * @author quxinjun
     * @updateTime 2021/8/5 12:44
     */
    GroupAssistantVO getGroupApiInfo(Long uid, String groupId);

    /**
     * @param uid     操作人id
     * @param groupId 群id
     * @title resetGroupToken
     * @description
     * @author quxinjun
     * @updateTime 2021/8/5 13:02
     */
    String resetGroupToken(Long uid, String groupId);

    /**
     * @param uid 操作人id
     * @title getUserAllGroupMembersInfo
     * @description 获取当前用户所有群的群成员信息
     * @author quxinjun
     * @updateTime 2021/9/8 13:40
     * @return: java.util.List<com.ys.web.user.friends.vo.UserGroupVO>
     */
    List<UserGroupVO> getUserAllGroupMembersInfo(Long uid);


    void addGroupMemberSize(String id, Integer memberSize);

    void insertRecord(String groupId, Long uid);

    int userGroupNumber(long uid);

    int groupUserBlack(long uid, String groupId, long blackUid);

    int groupUserBlackUn(long uid, String groupId, long blackUid);

    int groupUserBlackCount(long uid, String groupId);

    int groupUserByidBlackCount(long uid);
    /**
     * @author 但何非
     * @dateTime 2023/2/1 11:24
     * @param uid:
     * @param groupId:
     * @param searchKey:
     * @return java.util.List<com.ys.web.user.friends.vo.UnAuditVO>
     * @Description:群拉黑人员信息
     */
    List<UnAuditVO> groupUserBlackList(long uid,String groupId, String searchKey);

    List<Long> userGroupId(String uid);
}
